#include <iostream>
using namespace std;
void bubbleSort(int arr[7],int len){
    for(int i = 0; i<len; i++){
        for (size_t j = 0; j < len - i -1 ; j++)
        {
            /* code */
            if(arr[j] > arr[j + 1]){
                int temp = arr[j + 1];
                arr[j + 1] = arr [j];
                arr[j] = temp;
            }
        }
        
    }
}
void printArray(int arr[],int len){
    for(int i = 0; i < len; i++){
        printf("%d ",arr[i]);
    }
    printf("\n");
}
int main(){
    int arr[] = { 5,4,3,2,1,32,58};
    bubbleSort(arr,sizeof(arr)/sizeof(arr[0]));
    printArray(arr,sizeof(arr)/sizeof(arr[0]));
    return 0;
}